<template>
  <el-icon>
    <component :is="iconComponent" />
  </el-icon>
</template>

<script setup>
import { computed } from 'vue';
import * as ElementPlusIcons from '@element-plus/icons-vue'; // 导入所有图标

const props = defineProps({
  iconName: String, // 例如传入 "Files"
});

const iconComponent = computed(() => {
  return ElementPlusIcons[props.iconName]; // 动态获取图标组件
});
</script>